package commonClass;

/**
 * 包装类练习
 */
public class WrapperExercise01 {

    public static void main(String[] args) {

        /*
            判断如下代码是否正确
         */

        Double d = 100d; //ok 自动装箱 Double.valueOf(100d);

        Float f = 100f; //ok 自动装箱  Float.valueOf(1.5f)

        Object obj = true ? new Integer(1) : new Double(2.0);

        System.out.println(obj);//1.0

        Object obj2;

        if (true) {
            obj2 = new Integer(1);
        } else {
            obj2 = new Double(2.0);
        }

        System.out.println(obj2);//1
    }
}
